using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._BusinessAnalystTools._TradeAreas
{
    /// <summary>
    /// <para>Generate Approximate Drive Times</para>
    /// <para>Creates trade areas that approximate the size, shape, and area of existing polygons using available routes from the selected distance type.</para>
    /// <para>使用所选距离类型的可用路径创建近似现有面的大小、形状和面积的贸易区。</para>
    /// </summary>    
    [DisplayName("Generate Approximate Drive Times")]
    public class GenerateApproximateDriveTimes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateApproximateDriveTimes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input polygon feature layer.</para>
        /// <para>输入面要素图层。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class containing the drive time polygons.</para>
        /// <para>包含行驶时间面的输出要素类。</para>
        /// </param>
        /// <param name="_distance_type">
        /// <para>Distance Type</para>
        /// <para>The method of travel used to create the output polygons.</para>
        /// <para>用于创建输出面的旅行方法。</para>
        /// </param>
        public GenerateApproximateDriveTimes(object _in_features, object _out_feature_class, object _distance_type)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._distance_type = _distance_type;
        }
        public override string ToolboxName => "Business Analyst Tools";

        public override string ToolName => "Generate Approximate Drive Times";

        public override string CallName => "ba.GenerateApproximateDriveTimes";

        public override List<string> AcceptEnvironments => ["baDataSource", "baNetworkSource", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _distance_type, _units, _in_stores_layer, _store_id_field, _link_field, _iterations_limit, _minimum_step, _target_percent_diff, _travel_direction.GetGPValue(), _time_of_day, _time_zone.GetGPValue(), _search_tolerance, _polygon_detail.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input polygon feature layer.</para>
        /// <para>输入面要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class containing the drive time polygons.</para>
        /// <para>包含行驶时间面的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Distance Type</para>
        /// <para>The method of travel used to create the output polygons.</para>
        /// <para>用于创建输出面的旅行方法。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _distance_type { get; set; }


        /// <summary>
        /// <para>Distance Units</para>
        /// <para>The distance units to be used with the threshold values.</para>
        /// <para>要与阈值一起使用的距离单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _units { get; set; } = null;


        /// <summary>
        /// <para>Store Layer</para>
        /// <para>A point layer that will be used as the starting point for creating network service areas.</para>
        /// <para>将用作创建网络服务区的起点的点图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Store Layer")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_stores_layer { get; set; } = null;


        /// <summary>
        /// <para>Store ID Field</para>
        /// <para>The ID that uniquely identifies each Store Layer point.</para>
        /// <para>唯一标识每个存储层点的 ID。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Store ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _store_id_field { get; set; } = null;


        /// <summary>
        /// <para>Associated Store ID Field</para>
        /// <para>The ID that uniquely identifies each Input Features point.</para>
        /// <para>唯一标识每个输入要素点的 ID。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Associated Store ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _link_field { get; set; } = null;


        /// <summary>
        /// <para>Iterations Limit</para>
        /// <para>The maximum number of drive times that can be used to find the optimal threshold limit.</para>
        /// <para>可用于查找最佳阈值限制的最大行驶次数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Iterations Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _iterations_limit { get; set; } = null;


        /// <summary>
        /// <para>Minimum Step</para>
        /// <para>The minimum increment distance or time—for example, 1 mile or 1 min, used between iterations to expand until the threshold is reached.</para>
        /// <para>最小增量距离或时间（例如，1 英里或 1 分钟），用于在迭代之间展开，直到达到阈值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Step")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _minimum_step { get; set; } = null;


        /// <summary>
        /// <para>Threshold Percent Difference</para>
        /// <para>The maximum difference between the target value and threshold value when determining the threshold drive time—for example, 5%. The default value is 5.</para>
        /// <para>确定阈值驱动时间时目标值与阈值之间的最大差值，例如 5%。默认值为 5。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Threshold Percent Difference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _target_percent_diff { get; set; } = 5;


        /// <summary>
        /// <para>Travel Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction of travel for output polygon creation.</para>
        ///   <bulletList>
        ///     <bullet_item>Toward Stores—The direction of travel will be from customers to stores. This is the default.</bullet_item><para/>
        ///     <bullet_item>Away from Stores—The direction of travel will be from stores to customers.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出多边形创建的行进方向。</para>
        ///   <bulletList>
        ///     <bullet_item>朝向商店 - 行进方向将从客户到商店。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>远离商店 - 行进方向将从商店到客户。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _travel_direction_value _travel_direction { get; set; } = _travel_direction_value._TOWARD_STORES;

        public enum _travel_direction_value
        {
            /// <summary>
            /// <para>Toward Stores</para>
            /// <para>Toward Stores—The direction of travel will be from customers to stores. This is the default.</para>
            /// <para>朝向商店 - 行进方向将从客户到商店。这是默认设置。</para>
            /// </summary>
            [Description("Toward Stores")]
            [GPEnumValue("TOWARD_STORES")]
            _TOWARD_STORES,

            /// <summary>
            /// <para>Away from Stores</para>
            /// <para>Away from Stores—The direction of travel will be from stores to customers.</para>
            /// <para>远离商店 - 行进方向将从商店到客户。</para>
            /// </summary>
            [Description("Away from Stores")]
            [GPEnumValue("AWAY_FROM_STORES")]
            _AWAY_FROM_STORES,

        }

        /// <summary>
        /// <para>Time of Day</para>
        /// <para>The time and date that will be used when calculating distance.</para>
        /// <para>计算距离时将使用的时间和日期。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time of Day")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_of_day { get; set; } = null;


        /// <summary>
        /// <para>Time Zone</para>
        /// <para><xdoc>
        ///   <para>Specifies the time zone that will be used for the Time of Day parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</bullet_item><para/>
        ///     <bullet_item>UTC—Coordinated universal time (UTC) will be used.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于“时间”参数的时区。</para>
        ///   <bulletList>
        ///     <bullet_item>位置时区—将使用区域所在的时区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>UTC—将使用协调世界时 （UTC）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Zone")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_zone_value _time_zone { get; set; } = _time_zone_value._TIME_ZONE_AT_LOCATION;

        public enum _time_zone_value
        {
            /// <summary>
            /// <para>UTC</para>
            /// <para>UTC—Coordinated universal time (UTC) will be used.</para>
            /// <para>UTC—将使用协调世界时 （UTC）。</para>
            /// </summary>
            [Description("UTC")]
            [GPEnumValue("UTC")]
            _UTC,

            /// <summary>
            /// <para>Time Zone at Location</para>
            /// <para>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</para>
            /// <para>位置时区—将使用区域所在的时区。这是默认设置。</para>
            /// </summary>
            [Description("Time Zone at Location")]
            [GPEnumValue("TIME_ZONE_AT_LOCATION")]
            _TIME_ZONE_AT_LOCATION,

        }

        /// <summary>
        /// <para>Search Tolerance</para>
        /// <para><xdoc>
        ///   <para>The maximum distance that input points can be from the network.</para>
        ///   <para>The default value is 5000 meters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入点与网络的最大距离。</para>
        ///   <para>默认值为 5000 米。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Polygon Detail</para>
        /// <para><xdoc>
        ///   <para>Specifies the level of detail that will be used for the output drive time polygons.</para>
        ///   <bulletList>
        ///     <bullet_item>Standard—Polygons with a standard level of detail will be created. This is the default.</bullet_item><para/>
        ///     <bullet_item>Generalized—Generalized polygons will be created using the hierarchy present in the network data source to produce results quickly.</bullet_item><para/>
        ///     <bullet_item>High—Polygons with a high level of detail will be created for applications in which precise results are important.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于输出行驶时间多边形的细节级别。</para>
        ///   <bulletList>
        ///     <bullet_item>标准 - 将创建具有标准细节级别的面。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>广义—将使用网络数据源中存在的层次结构创建广义面，以快速生成结果。</bullet_item><para/>
        ///     <bullet_item>高 - 将为具有重要精确结果的应用程序创建具有高细节级别的面。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygon Detail")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _polygon_detail_value _polygon_detail { get; set; } = _polygon_detail_value._STANDARD;

        public enum _polygon_detail_value
        {
            /// <summary>
            /// <para>Standard</para>
            /// <para>Standard—Polygons with a standard level of detail will be created. This is the default.</para>
            /// <para>标准 - 将创建具有标准细节级别的面。这是默认设置。</para>
            /// </summary>
            [Description("Standard")]
            [GPEnumValue("STANDARD")]
            _STANDARD,

            /// <summary>
            /// <para>Generalized</para>
            /// <para>Generalized—Generalized polygons will be created using the hierarchy present in the network data source to produce results quickly.</para>
            /// <para>广义—将使用网络数据源中存在的层次结构创建广义面，以快速生成结果。</para>
            /// </summary>
            [Description("Generalized")]
            [GPEnumValue("GENERALIZED")]
            _GENERALIZED,

            /// <summary>
            /// <para>High</para>
            /// <para>High—Polygons with a high level of detail will be created for applications in which precise results are important.</para>
            /// <para>高 - 将为具有重要精确结果的应用程序创建具有高细节级别的面。</para>
            /// </summary>
            [Description("High")]
            [GPEnumValue("HIGH")]
            _HIGH,

        }

        public GenerateApproximateDriveTimes SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}